from Autotests.BaseTest import AirManagerTestCase
from Autotests.LocalMachine.Pages.AirManager.MainPage import WebMainPage
from Autotests.LocalMachine.Pages.AirManager.UserSettingsPage.LicenseTab import LicenseTab
from Autotests.LocalMachine.Pages.AirManager.UserSettingsPage.SupportTab import SupportTab


class LinkCheck(AirManagerTestCase):
    def test_Run(self):
        lc = LicenseTab()
        if lc.linkBuyNowClick():
            self.assertTrue(lc.isBuyNowPageActive(), "Link 'Buy Now' is inaccessible from CMC")

        sp = SupportTab()
        if sp.linkFaqClick():
            self.assertTrue(sp.isFaqPageActive(), "Link 'FAQ' is inaccessible from CMC")
        if sp.linkSubmitTicketClick():
            self.assertTrue(sp.ifSubmitTicketPageActive(), "Link 'Submit Ticket' is inaccessible from CMC")

        mp = WebMainPage()
        mp.viewCharts()
        self.assertTrue(mp.isChartShown(), "Charts bar hasn't been shown")
